
package cn.tang.tframe.druid.filter.qtmonitor;

import com.alibaba.druid.filter.AutoLoad;
import com.alibaba.druid.filter.stat.StatFilterContextListenerAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by tanghc on 17/1/16.
 */
@AutoLoad
public class QtmonitorContextListener extends StatFilterContextListenerAdapter {

	Logger logger = LoggerFactory.getLogger(this.getClass());

	@Override
	public void addUpdateCount(int updateCount) {

		logger.debug("updateCount={}", updateCount);
	}

	@Override
	public void addFetchRowCount(int fetchRowCount) {

		logger.debug("fetchRowCount={}", fetchRowCount);
	}

	@Override
	public void executeBefore(String sql, boolean inTransaction) {

		logger.debug(
			"executeBefore:sql={},inTransaction={}", sql, inTransaction);
	}

	@Override
	public void executeAfter(String sql, long nanos, Throwable error) {

		logger.debug(
			"executeAfter:sql={},nanos={},error={}", sql, nanos, error);
	}

	@Override
	public void commit() {

		logger.debug("commit");
	}

	@Override
	public void rollback() {

		logger.debug("rollback");
	}

	@Override
	public void pool_connect() {

		logger.debug("pool_connect");
	}

	@Override
	public void pool_close(long nanos) {

		logger.debug("pool_close");
	}

	@Override
	public void resultSet_open() {

		logger.debug("resultSet_open");
	}

	@Override
	public void resultSet_close(long nanos) {

		logger.debug("resultSet_close:nanos={}", nanos);
	}
}
